#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include "struct.h"
#include "functions.h"

circle minimum_enclosing_circle(const std::vector<point>& points, std::vector<point>& border, size_t quantity)
{
    if ((quantity == 0) || (border.size() == 3))
        return circle(border);
    else
    {
        circle round = minimum_enclosing_circle(points, border, quantity - 1);
        if (!point_in_circle(points[quantity - 1], round))
        {
            border.push_back(points[quantity - 1]);
            round = minimum_enclosing_circle(points, border, quantity - 1);
            border.pop_back();
        }
        return round;
    }
}

int main()
{
	std::ifstream in ("in.txt");
	std::ofstream out("out.txt");
	int n;

	in >> n;												//std::cin
	std::vector<point> points_list(n);
	for (int i = 0; i < n; i++)
		in >> points_list[i].x >> points_list[i].y;			//std::cin

	std::vector<point> boundaries;
    std::random_shuffle(points_list.begin(), points_list.end());
    circle round = minimum_enclosing_circle(points_list, boundaries, points_list.size());

    std::sort(round.border.begin(), round.border.end());
	//out
}